{{define "backstageIndex"}}
<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" type="text/css" href="../../static/layui/css/layui.css"/>
        <link rel="stylesheet" type="text/css" href="../../static/backstage/bgdefault.css" />
        <link rel="stylesheet" href="../../static/iconfont.css" />
        <link rel="icon" href="../../static/images/favicon.ico"/>
        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script src="../../static/layui/layui.js"></script>
        <link rel="stylesheet" type="text/css" href="../../static/backstage/left-side-menu.css">
        <script type="text/javascript" src="../../static/backstage/jquery.slimscroll.min.js"></script>
        <script type="text/javascript" src="../../static/backstage/left-side-menu.js"></script>
        <script type="text/javascript" src="../../static/md5.js"></script>
        <script>
            $(document).ready(function(){
                $('.lsm-sidebar-item').click(function(){
                     if(!$(this).hasClass('lsm-sidebar-show')){
                         $('.system-base').css({"background-color":"transparent"});
                     }
                    
                });
                $('.system-base').click(function(){
                    $(this).css({ "background-color": "#c55b03", "color": "#fff" });
                    $(this).siblings().css({"background-color":"transparent"});
                });
            });
        </script>
    </head>
    <body>
        <!--顶部栏-->
        <div>
            <div id="nav" class="allwidth">
                <!--导航-->
                <div>
                   <ul class="layui-nav" lay-filter="">
                       <li class="layui-nav-item">
                           <a href="/backstage/index">SwBlog后台管理</a>
                       </li>
                       <li class="layui-nav-item  layui-layout-right">
                           <a href="#">
                               <img id="navtx" src="{{.UserTx}}" class="layui-nav-img" />
                               <span id="author">{{.Author}}</span>
                           </a>
                           <!--<dl class="layui-nav-child">
                               <dd>修改密码</dd>
                               <dd>退出登录</dd>
                           </dl>-->
                       </li>            
                   </ul>
               </div>
           </div>
        </div>
        <!--主体内容-->
        <div id="content">
            <!--左侧导航-->
            <div id="c_left">
                <div class="left-side-menu" >
                    <!--<div class="lsm-expand-btn">
                        <div class="lsm-mini-btn">
                            <label>
                                <input type="checkbox" checked="checked">
                                <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                                    <circle cx="50" cy="50" r="30" />
                                    <path class="line--1" d="M0 40h62c18 0 18-20-17 5L31 55" />
                                    <path class="line--2" d="M0 50h80" />
                                    <path class="line--3" d="M0 60h62c18 0 18 20-17-5L31 45" />
                                </svg>
                            </label>
                
                        </div>
                
                    </div>-->
                    <div class="lsm-container">
                        <div class="lsm-scroll" >
                            <div class="lsm-sidebar">
                                <ul>
                                    <li class="lsm-sidebar-item">
                                        <a href="javascript:;"><i class="layui-icon layui-icon-set-fill"></i><span>系统设置</span><i class="layui-icon layui-icon-triangle-d lsm-sidebar-more"></i></a>
                                        <ul>
                                            
                                            <li id="baseconfig" class="system-base"><a href="javascript:;"><span>基础信息</span></a></li>
                                            <li id="userconfig" class="system-base"><a href="javascript:;"><span>用户信息</span></a></li>
                                            <li id="lunbo" class="system-base"><a href="javascript:;"><span>轮播图片</span></a></li>
                                        </ul>
                                    </li> 
                                    <li class="lsm-sidebar-item">
                                        <a href="javascript:;"><i class="layui-icon layui-icon-app"></i><span>文章管理</span><i class="layui-icon layui-icon-triangle-d lsm-sidebar-more"></i></a>
                                        <ul>
                                            <li id="articlelist" class="system-base"><a href="javascript:;"><span>文章总览</span></a></li>
                                            <li id="addart" class="system-base"><a href="javascript:;"><span>新增文章</span></a></li>
                                            
                                        </ul>
                                    </li>      
                                    <li class="lsm-sidebar-item">
                                        <a href="javascript:;"><i class="layui-icon layui-icon-dialogue"></i><span>评论管理</span><i class="layui-icon layui-icon-triangle-d lsm-sidebar-more"></i></a>
                                        <ul>
                                            <li class="system-base"><a href="javascript:;"><span>新增评论审核</span></a></li>
                                            <li class="system-base"><a href="javascript:;"><span>历史评论管理</span></a></li>
                                            
                                        </ul>
                                    </li> 
                                    <li class="lsm-sidebar-item">
                                        <a href="javascript:;"><i class="layui-icon layui-icon-note"></i><span>分类&amp;标签</span><i class="layui-icon layui-icon-triangle-d lsm-sidebar-more"></i></a>
                                        <ul>
                                            <li id="classify" class="system-base"><a href="javascript:;"><span>分类管理</span></a></li>
                                            <li id="tags" class="system-base"><a href="javascript:;"><span>标签管理</span></a></li>
                                            
                                        </ul>
                                    </li>                                  
                                </ul>
                            </div>
                        </div>
                    </div>
                
                </div>
            </div>
            <!--右侧主体内容-->
            <div id="c_right">
                <div id="c-r-content">
                   {{template "backstagedefault" .}}
                   
                </div>
            </div>
            <!--清除浮动-->
            <div class="clear"></div>
        </div>
    </body>
    <footer>
        {{template "footer"}}
    </footer>
    <script>
        layui.use(['layer','form'],function(){
            var layer=layui.layer;
            //web基础配置
            $('#baseconfig').click(function(){
                    var urlstr='/backstage/wbconfig';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });
        
            //用户基础信息
            $('#userconfig').click(function(){
                    var urlstr='/backstage/wuconfig';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });
                //articlelist
                $('#articlelist').click(function(){
                    var urlstr='/backstage/artbaklist';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });
                $('#addart').click(function(){
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                            url:'/backstage/articleaddpage',
                            type:'get',
                            async:true,
                            timeout:5000,
                            success:function(data){
                                layer.close(loading);
                                //成功返回
                                $('#c-r-content').html(data);
                            },
                            error:function(){
                                layer.close(loading);
                                layer.open({
                                    title: '服务器无响应',
                                    content: "服务器跑到月球啦！！"
                                });
                            }
                        });
                });
        
                $('#classify').click(function(){
                    var urlstr='/backstage/classify';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });   
                $('#tags').click(function(){
                    var urlstr='/backstage/tagcfg';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });   
                $('#lunbo').click(function(){
                    var urlstr='/backstage/lunbo';
                    var loading = layer.msg('加载中...', {icon: 16, shade: 0.3, time:0});
                    $.ajax({
                        type:'get',
                        url:urlstr,
                        async:true,
                        timeout:5000,
                        success:function(data){
                            layer.close(loading);
                            $('#c-r-content').html(data);
                        },
                        error:function(){
                            layer.close(loading);
                            layer.open({
                                title: '服务器无响应',
                                content: "服务器跑到月球啦！！"
                            });
                        }
                    });
                });   
            
        });
        
    </script>
</html>
{{end}}